/*
sudo apt install gpiod libgpiod-dev

g++ -o ./bin/ul ul_test_gpiod.cpp ./src/hc_sr04.cpp -I./src -Wall -lgpiod 
*/
#include <iostream>
#include "hc_sr04.h"

using namespace std;

int trigger = 15;
int echo = 14;

int main()
{
    HCSR04 ultrasonic;
    ultrasonic.init(trigger, echo);

    while(1){
        cout << "Distance is " << ultrasonic.distance(1000000) << " cm." << endl;
    }
}